﻿<UserControl x:Class="DMC.UI.Auth.UserLogin"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:this="clr-namespace:DMC.UI.Auth">
    <UserControl.Resources>
        <Style TargetType="TextBlock" x:Key="TextBlockStyle">
            <Setter Property="FontSize" Value="24" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Margin" Value="5" />
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="FontSize" Value="24" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Margin" Value="5" />
        </Style>
        <Style TargetType="PasswordBox">
            <Setter Property="FontSize" Value="24" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Margin" Value="5" />
        </Style>
        <Style TargetType="Button">
            <Setter Property="Height" Value="30" />
            <Setter Property="Width" Value="75" />
            <Setter Property="Margin" Value="20" />
        </Style>

        <!--<this:UserLoginViewModel x:Key="vm" />-->
    </UserControl.Resources>
    
    <Border BorderThickness="8" CornerRadius="20" Padding="5" BorderBrush="SteelBlue">
        <Grid DataContext="{Binding Source={StaticResource vm}}">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" FontStyle="Italic" Foreground="LightGray" Text="User Name..." Visibility="Hidden">
                <TextBlock.Style>
                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TextBlockStyle}" >
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding ElementName=txtUser, Path=Text.Length}" Value="0">
                                <Setter Property="FrameworkElement.Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
            <TextBox Grid.Row="0" Name="txtUser" Background="Transparent" />
            <TextBlock Grid.Row="1" FontStyle="Italic" Foreground="LightGray" Text="Password..." />
            <PasswordBox Grid.Row="1" Name="txtPass" Background="Transparent"/>
            <StackPanel Grid.Row="2" Orientation="Horizontal">
                <Button Grid.Row="2" Grid.Column="0" Name="btnCancel" IsCancel="True">Cancel</Button>
                <Button Grid.Row="2" Grid.Column="1" Name="btnLogin" IsDefault="True">Login</Button>
            </StackPanel>
        </Grid>
    </Border>

    <!--</Grid>-->
</UserControl>
